<template>
	<textarea @click="click" style="text-align: left;" :maxlength="_keys.maxlength || -1" class="input" :disabled="_keys.disabled" :type="_keys.type" :value="value" @input="updateValue" :placeholder="_keys.placeholder" />
</template>

<script>
	export default {
		name:"yTextarea",
		props: {
			value: '',
			keys: {}
		},
		data() {
			return {}
		},
		computed: {
			_keys() {
				return {
					disabled: false,
					type: 'text',
					placeholder: "请输入",
					...this.keys
				}
			}
		},
		methods: {
			updateValue(e) {
				//检测类型
				//整数 Integer
				this.$emit('input', e.target.value);
			},
			click(e){
				typeof this._keys.click === "function" && this._keys.click();
			}
		}
	}
</script>

<style lang="scss">
	.input {
		font-size: inherit;
		width: 100%;
		max-height: 100px;
	}
</style>
